package com.itheima.Set.TreeSet.二叉树降序;

import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;

import java.util.Collections;
import java.util.Comparator;
import java.util.TreeSet;

public class MyTreeSet5 {
    public static void main(String[] args) {
        TreeSet<Integer>TrI=new TreeSet<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {

                return o2-o1;

            }
        });
        TrI.add(10);
        TrI.add(9);
        TrI.add(5);
        TrI.add(7);
        TrI.add(8);

        for (Integer integer : TrI) {
            System.out.println(integer);
        }
    }
}
